package com.dong.common.core;

import java.io.Serializable;

/**
 * @author Mr.dongchao
 */
public class Result implements Serializable {
    private static final long serialVersionUID = -1204719308006698682L;

    private String code ;
    private String msg ;

    public Result(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static Result ok(){
        return new Result("200","调用成功");
    }

    public static Result error(String errorMsg){
        return new Result("500",errorMsg);
    }

    @Override
    public String toString() {
        return "Result{" +
                "code='" + code + '\'' +
                ", msg='" + msg + '\'' +
                '}';
    }
}
